<?php
abstract class Customer
{
    protected $name="";
    /** @return bool */
    public abstract function isNil();
    /** @return string */
    public abstract function getName();
}
class RealCustomer extends Customer
{
    public function __construct($name)
    {
        $this->name = $name;
    }
    public function getName()
    {
        return $this->name;
    }
    public function isNil()
    {
        return false;
    }
}
class NullCustomer extends Customer
{
    public function getName()
    {
       return "Not Available in Customer Database";
    }
    public function isNil()
    {
       return true;
    }
}
class CustomerFactory
{
    public $names=["Rob", "Joe", "Julie"];
    public function getCustomer($name){
        if(in_array($name, $this->names)){
            return new RealCustomer($name);
        }
        else return new NullCustomer;
    }
}

$factory = new CustomerFactory;
echo $factory->getCustomer("Rob")->getName() ."\r\n";
echo $factory->getCustomer("John")->getName() ."\r\n";
